class utf_string
{
public:
- utf_string() :
- is_html(false)
- {};
- bool is_html;
+ utf_string() = default;
+ utf_string(bool html, const QString& str) :
+ is_html{html},
+ utfstring{str}
+ {}
+ bool is_html{false};
QString utfstring;
};
class gb_color
{
public:
- gb_color() :
- bbggrr(-1),
- opacity(255) {}
- int bbggrr; // 32 bit color: Blue/Green/Red. < 0 == unknown.
- unsigned char opacity; // 0 == transparent. 255 == opaque.
+ int bbggrr{-1}; // 32 bit color: Blue/Green/Red. < 0 == unknown.
+ unsigned char opacity{255}; // 0 == transparent. 255 == opaque.
};
class UrlLink
{
public:
- UrlLink() { }
+ UrlLink() = default;
UrlLink(const QString& url) :
url_(url)
{ }
if (instructions == nullptr) {
routehead->rte_desc = QString("Step %1").arg(goog_step);
} else {
- utf_string utf;
- utf.is_html = true;
- utf.utfstring = instructions;
+ utf_string utf(true, instructions);
char *s = strip_html(&utf);
routehead->rte_desc = s;
xfree(s);
class GPS_PPacket {
public:
- GPS_PPacket() : type(0), n(0) {
- memset(data, 0, MAX_GPS_PACKET_SIZE);
- }
- US type;
- uint32 n;
- UC data[MAX_GPS_PACKET_SIZE];
+ US type{0};
+ uint32 n{0};
+ UC data[MAX_GPS_PACKET_SIZE]{};
};
#define ICON_DIR ICON_BASE "track-directional/track-%1.png" // format string where next arg is rotational degrees.
static struct {
- float seq;
- float step;
+ float seq{0.0f};
+ float step{0.0f};
gb_color color;
} kml_color_sequencer;
#define KML_COLOR_LIMIT 204 /* allowed range [0,255] */
class QargStackElement
{
public:
- int argn;
+ int argn{0};
QStringList qargs;
public:
char* kml = nullptr;
if (strcmp(wpt->session->name, "kml") == 0) {
- utf_string tmp;
-
- tmp.utfstring = cx;
- tmp.is_html = true;
+ utf_string tmp(true, cx);
cx = kml = strip_html(&tmp);
}
str += cx;
#define TRACKNAMELENGTH 256
class StyleInfo {
public:
- StyleInfo() {
- color[0] = 0;
- color[1] = 0;
- color[2] = 0;
- wide = dash = 0;
- }
QString name;
- uint8_t color[3]; // keep R/G/B values separate because line_color needs BGR
- uint8_t wide;
- uint8_t dash;
+ uint8_t color[3]{0, 0, 0}; // keep R/G/B values separate because line_color needs BGR
+ uint8_t wide{0};
+ uint8_t dash{0};
};
// Track decoder for version 3.x files. This block contains tracks